-
Notifications
You must be signed in to change notification settings - Fork 968
xpay: payment description #8784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
xpay: payment description #8784
Conversation
219da3a to
c15a836
Compare
644563e to
51e5ed7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Nazarevsky Thanks for the PR! Since this is your first contribution, I’m being a bit more nitpicky about commit structure. Even if this one doesn’t end up being merged for the reason below, this review should be useful as a reference for future PRs.
That said, I wanted to better understand whether this PR serves its intended purpose. Don’t the existing invoice.description and fetchinvoice.payer_note already cover this use case? A node can already inspect these via listinvoices. How is the payer_note sent via xpay received on the other node? Adding @Lagrang3 in case I’ve missed anything.
Thank you @ShahanaFarooqui for comments! I've updated my PR description a bit about my changes. Nevertheless, I'd like to answer your questions here. I think that |
Why a sender cannot attach an arbitrary description to a Lightning payment:BOLT 4 (Onion Routing Protocol) defines the Lightning payment routing layer and specifies exactly what data is carried hop-by-hop in a payment. According to BOLT 4:
By contrast, descriptions are defined only at the invoice layer:BOLT 11 invoices include a d (description) or h (description hash) field, set by the invoice creator (receiver) Summary
|
|
Thank you for referencing, it makes much more sense to me now 👍 |
|
Thanks for the PR @Nazarevsky, I may be missing the purpose of it. There are plenty of places in both CLN and the spec where a As far as I see we only have XXX times that a description leaves one node and ends up at another node:
I'm not against sending an optional message along with the payment, however notice that the spec does not have a field to transport this message, and the recipient has no handling / storing of any received message. If we want to go down this road, we should at least remember the messages we get ourselves first :-) Anyway, as mentioned, I may be completely off, so please share your intent and we can work off of that ^^ EDIT: reading the OP again, it seems clear that there is a bit of confusion what the scope is. BOLT11 is the payment descriptor in the form of an BOLT12 takes a step back, we don't have an invoice yet, we need to negotiate one. The prospective sender, given the recipient ID, talks to it, providing all the details for the payment it intends to perform. The recipient takes that information and returns an invoice. So BOLT12 tells you how to get an invoice, BOLT11 tells you what is in the invoice, and |
|
Thank you for joining @cdecker!
Basically, my intent was to provide some custom message using Current implementation already has payer_note field in
I also think so.
Yes, since there is no way to provide payment description when paying BOLT11 invoices, I decided to leave it as it is. |
|
My bad, I totally blanked on the fact that I think this is good as is, and can be merged 👍 |
3bd4374 to
5c691d7
Compare
Changelog-Added: Add 'payer-note' field to the 'xpay' RPC call.
5c691d7 to
faff902
Compare
Resolves #8514
Problem
xpayRPC call sends funds using Bolt11 or Bolt12 invoices provided. According to Bolt12, Bolt12 invoices support providing descriptions for invoices ('description' field) and messages to a payee on an invoice layer ('invreq_payer_note' field).xpayhas a couple of RPC calls (likefetchinvoiceorcreate_invoice) under the hood which already have a corresponding logic for sending a custom message to a payee (usingpayer_notefield). However,xpaydoes not have a field to provide payment description.Changes
payer_notefiled toxpayRPC call;payer_notedefined.Important
26.04 FREEZE March 11th: Non-bugfix PRs not ready by this date will wait for 26.06.
RC1 is scheduled on March 23rd
The final release is scheduled for April 15th.
Checklist
Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked:
tools/lightning-downgrade